package net.digitalartwork.geoslideshow {
	import flash.display.*;
	import flash.geom.Point;
	import flash.geom.Rectangle;
	import flash.utils.*;
	import flash.events.*;
	import flash.net.*;
	import flash.text.TextField;
	
	
	import gs.TweenFilterLite;
	import gs.OverwriteManager;
	import gs.easing.*;
	
	
	public class DACaptionBox extends MovieClip{

		
		public var caption_bounds:MovieClip;
		
		public var caption_titleToggle:MovieClip;
		public var bg:MovieClip;
		public var metadata_box:MovieClip;
		

		
		//--------------------------------------------------------------------------
		// Properties
		//--------------------------------------------------------------------------


		
		public function DACaptionBox() {
			trace("DACaptionBox Init");
			
			
			metadata_box.caption_text.autoSize = "left";

			
		}
		
		public function updateDisplay(w:Number=300):void {
			//caption_text.width = w;
			//caption_bounds.width = w +20;
			//caption_bounds.height = caption_text.textHeight + caption_text.y + 10;
		}
		public function hideCaption():void {
			
		}
		
		public function changeText(xmlData:XML):void {
			TweenFilterLite.to(metadata_box, .5, {alpha:0, ease:Linear.easeNone, onComplete:changeIt});
			
			function changeIt():void {
				metadata_box.caption_text.text = xmlData.description[0];
				metadata_box.credit_text.text = xmlData.credit[0];
				metadata_box.date_text.text = xmlData.exif[0].date[0];
				metadata_box.camera_text.text = xmlData.exif[0].camera[0];
				metadata_box.lens_text.text = xmlData.exif[0].lens[0];
				metadata_box.iso_text.text = xmlData.exif[0].iso[0];
				metadata_box.exposure_text.text = xmlData.exif[0].exposure[0];
				
				TweenFilterLite.to(metadata_box, 1, {alpha:1, ease:Linear.easeNone});
			}
			
			
		}
		
		/*
		public function changeText(cap:String="", cred:String=""):void {
			TweenFilterLite.to(caption_text, .5, {alpha:0, ease:Expo.easeInOut, onComplete:changeIt});
			//credit_text.alpha = 0;
			//caption_text.alpha = 0;
			function changeIt():void {
				caption_text.text = cap;
				//credit_text.text = cred;
				TweenFilterLite.to(caption_text, .5, {alpha:1, ease:Expo.easeInOut});
			}
			
		}
		*/
		
	}
	
}